const p = new Promise((resolve,reject) => {
    reject('error');
});

//then时调用失败和成功的回调
//catch是调用失败的回调
p.catch(reason => {
    console.log(reason);//error
})